package xp2p.app.cli;

import java.util.ArrayList;

public class Args
{
	boolean join;
	int size;
	String[] args;
	public static Args parse(String[] args)
	{
		Args result = new Args();
		result.join = (args[0].compareTo("join") == 0);
		if (!result.join)
		{
			result.size = Integer.parseInt(args[0]);
		}
		ArrayList<String> otherArgs = new ArrayList<String>();
		for (int i = 1; i < args.length; i++)
		{
			otherArgs.add(args[i]);
		}
		result.args = otherArgs.toArray(new String[0]);
		return result;
	}
}
